﻿using Compass.Wasm.Shared;
using Compass.Wasm.Shared.Charts;
using Compass.Wasm.Shared.Purchases;
using System.Net.Http.Json;

namespace Compass.Wasm.Client.Services.Purchases;
public interface INavInvReportClassService : IBaseService<NavInvReportClassDto>
{
    Task<List<ChartDoubleDataDto>> GetBlazorFsSubtotalAsync();
    
}
public class NavInvReportClassService:BaseService<NavInvReportClassDto>,INavInvReportClassService
{
    #region ctor
    private readonly HttpClient _http;
    private const string ServiceName = "NavInvReportClass";
    public NavInvReportClassService(HttpClient http) : base(http, ServiceName)
    {
        _http = http;
    } 
    #endregion


    public async Task<List<ChartDoubleDataDto>> GetBlazorFsSubtotalAsync()
    {
        var response = await _http.GetFromJsonAsync<ApiResponse<List<ChartDoubleDataDto>>>($"api/{ServiceName}/Blazor/FsSubtotal");
        return response.Status ? response.Result : new List<ChartDoubleDataDto>();
    }
}